﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiFastExtCalc : TempOdGiTransformed
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiFastExtCalc(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiFastExtCalc_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiFastExtCalc obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiFastExtCalc()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiFastExtCalc(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public void resetExtents()
		{
			GlobalsPINVOKE.OdGiFastExtCalc_resetExtents(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getExtents(OdGeExtents3d extents)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_getExtents(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setDrawInvisible(bool bSet)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_setDrawInvisible(this.swigCPtr, bSet);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isDrawInvisible()
		{
			bool result = GlobalsPINVOKE.OdGiFastExtCalc_isDrawInvisible(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDrawInvisibleNested(bool bSet)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_setDrawInvisibleNested(this.swigCPtr, bSet);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isDrawInvisibleNested()
		{
			bool result = GlobalsPINVOKE.OdGiFastExtCalc_isDrawInvisibleNested(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void resetFirstDrawFlag()
		{
			GlobalsPINVOKE.OdGiFastExtCalc_resetFirstDrawFlag(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool regenAbort()
		{
			bool result = GlobalsPINVOKE.OdGiFastExtCalc_regenAbort(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual double deviation(OdGiDeviationType deviationType, OdGePoint3d pointOnCurve)
		{
			double result = GlobalsPINVOKE.OdGiFastExtCalc_deviation(this.swigCPtr, (int)deviationType, OdGePoint3d.getCPtr(pointOnCurve));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdGiRegenType regenType()
		{
			OdGiRegenType result = (OdGiRegenType)GlobalsPINVOKE.OdGiFastExtCalc_regenType(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new void circle(OdGePoint3d center, double radius, OdGeVector3d normal)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_circle__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(center), radius, OdGeVector3d.getCPtr(normal));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void circle(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_circle__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(firstPoint), OdGePoint3d.getCPtr(secondPoint), OdGePoint3d.getCPtr(thirdPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void circularArc(OdGePoint3d center, double radius, OdGeVector3d normal, OdGeVector3d startVector, double sweepAngle, OdGiArcType arcType)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_circularArc__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(center), radius, OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(startVector), sweepAngle, (int)arcType);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void circularArc(OdGePoint3d center, double radius, OdGeVector3d normal, OdGeVector3d startVector, double sweepAngle)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_circularArc__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(center), radius, OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(startVector), sweepAngle);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void circularArc(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint, OdGiArcType arcType)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_circularArc__SWIG_2(this.swigCPtr, OdGePoint3d.getCPtr(firstPoint), OdGePoint3d.getCPtr(secondPoint), OdGePoint3d.getCPtr(thirdPoint), (int)arcType);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void circularArc(OdGePoint3d firstPoint, OdGePoint3d secondPoint, OdGePoint3d thirdPoint)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_circularArc__SWIG_3(this.swigCPtr, OdGePoint3d.getCPtr(firstPoint), OdGePoint3d.getCPtr(secondPoint), OdGePoint3d.getCPtr(thirdPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void polyline(OdGePoint3d[] numVertices, OdGeVector3d pNormal, IntPtr baseSubEntMarker)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_polyline__SWIG_0(this.swigCPtr, intPtr, OdGeVector3d.getCPtr(pNormal), baseSubEntMarker);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public new void polyline(OdGePoint3d[] numVertices, OdGeVector3d pNormal)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_polyline__SWIG_1(this.swigCPtr, intPtr, OdGeVector3d.getCPtr(pNormal));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public new void polyline(OdGePoint3d[] numVertices)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_polyline__SWIG_2(this.swigCPtr, intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public new void polygon(OdGePoint3d[] numVertices)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_polygon(this.swigCPtr, intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public new void pline(OdGiPolyline polyline, uint fromIndex, uint numSegs)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_pline__SWIG_0(this.swigCPtr, OdGiPolyline.getCPtr(polyline), fromIndex, numSegs);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void pline(OdGiPolyline polyline, uint fromIndex)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_pline__SWIG_1(this.swigCPtr, OdGiPolyline.getCPtr(polyline), fromIndex);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void pline(OdGiPolyline polyline)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_pline__SWIG_2(this.swigCPtr, OdGiPolyline.getCPtr(polyline));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void shape(OdGePoint3d position, OdGeVector3d normal, OdGeVector3d direction, int shapeNumber, OdGiTextStyle pTextStyle)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_shape(this.swigCPtr, OdGePoint3d.getCPtr(position), OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(direction), shapeNumber, OdGiTextStyle.getCPtr(pTextStyle));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void text(OdGePoint3d position, OdGeVector3d normal, OdGeVector3d direction, double height, double width, double oblique, string msg)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_text__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(position), OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(direction), height, width, oblique, msg);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void text(OdGePoint3d position, OdGeVector3d normal, OdGeVector3d direction, string msg, bool raw, OdGiTextStyle pTextStyle)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_text__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(position), OdGeVector3d.getCPtr(normal), OdGeVector3d.getCPtr(direction), msg, raw, OdGiTextStyle.getCPtr(pTextStyle));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void xline(OdGePoint3d firstPoint, OdGePoint3d secondPoint)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_xline(this.swigCPtr, OdGePoint3d.getCPtr(firstPoint), OdGePoint3d.getCPtr(secondPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void ray(OdGePoint3d basePoint, OdGePoint3d throughPoint)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_ray(this.swigCPtr, OdGePoint3d.getCPtr(basePoint), OdGePoint3d.getCPtr(throughPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void nurbs(OdGeNurbCurve3d nurbsCurve)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_nurbs(this.swigCPtr, OdGeNurbCurve3d.getCPtr(nurbsCurve));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void ellipArc(OdGeEllipArc3d ellipArc, OdGePoint3d[] endPointsOverrides, OdGiArcType arcType)
		{
			IntPtr intPtr = Helpers.MarshalPointPair(endPointsOverrides);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_ellipArc__SWIG_0(this.swigCPtr, OdGeEllipArc3d.getCPtr(ellipArc), intPtr, (int)arcType);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				if (intPtr != IntPtr.Zero)
				{
					Marshal.FreeCoTaskMem(intPtr);
				}
			}
		}

		public new void ellipArc(OdGeEllipArc3d ellipArc, OdGePoint3d[] endPointsOverrides)
		{
			IntPtr intPtr = Helpers.MarshalPointPair(endPointsOverrides);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_ellipArc__SWIG_1(this.swigCPtr, OdGeEllipArc3d.getCPtr(ellipArc), intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				if (intPtr != IntPtr.Zero)
				{
					Marshal.FreeCoTaskMem(intPtr);
				}
			}
		}

		public new void ellipArc(OdGeEllipArc3d ellipArc)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_ellipArc__SWIG_2(this.swigCPtr, OdGeEllipArc3d.getCPtr(ellipArc));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void mesh(MeshData numRows)
		{
			IntPtr intPtr = Helpers.MarshalMeshData(numRows);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_mesh(this.swigCPtr, intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public new void shell(ShellData numVertices)
		{
			IntPtr intPtr = Helpers.MarshalShellData(numVertices);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_shell(this.swigCPtr, intPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public new void worldLine(OdGePoint3d points)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_worldLine(this.swigCPtr, OdGePoint3d.getCPtr(points));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void image(OdGiImageBGRA32 img, OdGePoint3d origin, OdGeVector3d uVec, OdGeVector3d vVec, OdGiRasterImage.TransparencyMode trpMode)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_image__SWIG_0(this.swigCPtr, OdGiImageBGRA32.getCPtr(img), OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(uVec), OdGeVector3d.getCPtr(vVec), (int)trpMode);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void image(OdGiImageBGRA32 img, OdGePoint3d origin, OdGeVector3d uVec, OdGeVector3d vVec)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_image__SWIG_1(this.swigCPtr, OdGiImageBGRA32.getCPtr(img), OdGePoint3d.getCPtr(origin), OdGeVector3d.getCPtr(uVec), OdGeVector3d.getCPtr(vVec));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void polypoint(OdGePoint3d[] numPoints, OdCmEntityColor pColors, OdGeVector3d pNormals, IntPtr[] pSubEntMarkers)
		{
			IntPtr intPtr = Teigha.Core.Helpers.MarshalPoint3dArray(numPoints);
			try
			{
				GlobalsPINVOKE.OdGiFastExtCalc_polypoint(this.swigCPtr, intPtr, OdCmEntityColor.getCPtr(pColors), OdGeVector3d.getCPtr(pNormals), Helpers.MarshalIntPtrFixedArray(pSubEntMarkers));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public virtual void rowOfDots(int numPoints, OdGePoint3d startPoint, OdGeVector3d dirToNextPoint)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_rowOfDots(this.swigCPtr, numPoints, OdGePoint3d.getCPtr(startPoint), OdGeVector3d.getCPtr(dirToNextPoint));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void setExtents(OdGePoint3d newExtents)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_setExtents(this.swigCPtr, OdGePoint3d.getCPtr(newExtents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void pushClipBoundary(OdGiClipBoundary pBoundary)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_pushClipBoundary(this.swigCPtr, OdGiClipBoundary.getCPtr(pBoundary));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void popClipBoundary()
		{
			GlobalsPINVOKE.OdGiFastExtCalc_popClipBoundary(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void pushModelTransform(OdGeMatrix3d xfm)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_pushModelTransform(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void popModelTransform()
		{
			GlobalsPINVOKE.OdGiFastExtCalc_popModelTransform(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new void draw(OdGiDrawable pDrawable)
		{
			GlobalsPINVOKE.OdGiFastExtCalc_draw(this.swigCPtr, OdGiDrawable.getCPtr(pDrawable));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
